def Record(RECORD_SECONDS=3):
    stream = p.open(format=pyaudio.paInt16, 
                channels=1, 
                rate=16000, 
                input=True, 
                frames_per_buffer=1024) 
    print("共"+str(RECORD_SECONDS)+"秒录音")
    print("开始录音,请说话......") 
     
    frames = [] 
     
    for i in range(0, int(16000 / 1024 * RECORD_SECONDS)):
        data = stream.read(1024) 
        frames.append(data)
     
    print("录音结束!") 
    stream.stop_stream() 
    stream.close() 
     
    wf = wave.open("/home/pi/Desktop/HTE_voice.wav", 'wb') 
    wf.setnchannels(1) 
    wf.setsampwidth(p.get_sample_size(pyaudio.paInt16)) 
    wf.setframerate(16000) 
    wf.writeframes(b''.join(frames)) 
    wf.close()